export function GetRequest() {
	var url = location.search;
	//获取url中"?"符后的字串
	var theRequest = new Object();

	if (url.indexOf('?') != -1) {
		var str = url.substring(1);
		var strs = str.split('&');
		for (var i = 0; i < strs.length; i++) {
			theRequest[strs[i].split('=')[0]] = unescape(strs[i].split('=')[1]);
		}
	}
	return theRequest;
}

export function curDate() {
	var date = new Date();
	const year = date.getFullYear(); //获取完整的年份(4位)
	const month = date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
	const day = date.getDate(); //当前日期
	let curdate =
		year +
		'-' +
		(month > 9 ? String(month) : +'0' + String(month)) +
		'-' +
		(day > 9 ? String(day) : +'0' + String(day));
	return curdate
}

export function curDateTime() {
	var date = new Date();
	const year = date.getFullYear(); //获取完整的年份(4位)
	const month = date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
	const day = date.getDate(); //当前日期
	const hours = date.getHours(); //获取当前小时数(0-23)
	const minutes = date.getMinutes(); //获取当前分钟数(0-59)
	let curdate =
		year +
		'-' +
		(month > 9 ? String(month) : +'0' + String(month)) +
		'-' +
		(day > 9 ? String(day) : +'0' + String(day));
	let curTime =
		(hours > 9 ? String(hours) : +'0' + String(hours)) +
		':' +
		(minutes > 9 ? String(minutes) : +'0' + String(minutes));
	return curdate + ' ' + curTime;
}
